# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=py3-xsdata
pkgver=23.8
pkgrel=0
pkgdesc="Naive XML & JSON Bindings for python"
url="https://github.com/tefra/xsdata"
arch="noarch"
license="MIT"
# cli feature deps
depends="
	py3-click
	py3-click-default-group
	py3-docformatter
	py3-jinja2
	py3-toposort
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-lxml
	py3-pytest-benchmark
	py3-pytest-forked
	py3-requests
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tefra/xsdata/archive/refs/tags/v$pkgver.tar.gz
	typing.patch
	"
builddir="$srcdir/xsdata-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest --forked
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	# rm -r "$pkgdir"/usr/lib/python*/site-packages/bite/tests
}

sha512sums="
ae53d6c0bf5fb24fcbe097f00d1e431b45a6ae1b09d9fce925b9d8b414537b855261524c184a645744914361c4a1c7b8e8175dda181937cd1d57592e790ac82b  py3-xsdata-23.8.tar.gz
06bdf559a031b986b14647095f35d2147a6f56a248c6d826b03e38ef78ff712969f5575a01569ec7e02587481c67f1a0372118693a8777ac22b75e0cc787efcd  typing.patch
"
